﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace AnimaGestionPersonnage.Utilities
{
    public class CharacterClass : IEquatable<CharacterClass>, IEquatable<String>
    {
        public String name { get; set; }
        public Archetype type { get; set; }
        public int lpLevel { get; set; }
        public int initiative { get; set; }
        public int DILevel { get; set; }
        public float pppLevel { get; set; }
        public List<SkillMod> normalCosts { get; set; }
        public List<SkillMod> reducedCosts { get; set; }
        public List<SkillMod> levelBonuses { get; set; }

        public CharacterClass()
        {
            normalCosts = new List<SkillMod>();
            reducedCosts = new List<SkillMod>();
            levelBonuses = new List<SkillMod>();
        }

        public CharacterClass(String name) : this()
        {
            this.name = name;

            normalCosts.Add(new SkillMod(Utils.LP_MULTI, 0));
            normalCosts.Add(new SkillMod(Utils.ATTACK, 0));
            normalCosts.Add(new SkillMod(Utils.BLOCK, 0));
            normalCosts.Add(new SkillMod(Utils.DODGE, 0));
            normalCosts.Add(new SkillMod(Utils.WEAR_ARMOR, 0));
            normalCosts.Add(new SkillMod(Utils.ACC_KI, 0));
            normalCosts.Add(new SkillMod(Utils.KI, 0));
            normalCosts.Add(new SkillMod(Utils.ZEON, 0));
            normalCosts.Add(new SkillMod(Utils.MA_MULTIP, 0));
            normalCosts.Add(new SkillMod(Utils.MAGIC_PRO, 0));
            normalCosts.Add(new SkillMod(Utils.SUMMON, 0));
            normalCosts.Add(new SkillMod(Utils.CONTROL, 0));
            normalCosts.Add(new SkillMod(Utils.BIND, 0));
            normalCosts.Add(new SkillMod(Utils.BANISH, 0));
            normalCosts.Add(new SkillMod(Utils.PPP, 0));
            normalCosts.Add(new SkillMod(Utils.PSY_PRO, 0));
            normalCosts.Add(new SkillMod(Utils.MARTIAL_LIMIT, 0));
            normalCosts.Add(new SkillMod(Utils.MYSTIC_LIMIT, 0));
            normalCosts.Add(new SkillMod(Utils.PSY_LIMIT, 0));
            normalCosts.Add(new SkillMod(Utils.ATHLETIC, 0));
            normalCosts.Add(new SkillMod(Utils.VIGOR, 0));
            normalCosts.Add(new SkillMod(Utils.PERCEPTION, 0));
            normalCosts.Add(new SkillMod(Utils.INTELECTUAL, 0));
            normalCosts.Add(new SkillMod(Utils.SOCIAL, 0));
            normalCosts.Add(new SkillMod(Utils.SUBTERFUGE, 0));
            normalCosts.Add(new SkillMod(Utils.CREATIVE, 0));
        }

        public override string ToString()
        {
            return this.name;
        }

        public bool Equals(CharacterClass otherClass)
        {
            return name.Equals(otherClass.name);
        }

        public bool Equals(String otherClass)
        {
            return name.Equals(otherClass);
        }
    }
}
